import time
from appium import webdriver
def init_driver():
    desires_caps = {}
    desires_caps['platformName'] = 'Android'
    desires_caps['platformVersion'] = '5.1.1'
    desires_caps['deviceName'] = '127.0.0.1:62001'
    desires_caps['appPackage'] = 'edu.yjyx.student'
    desires_caps['appActivity'] = '.module.main.ui.AccessActivity'
    desires_caps['unicodeKeyboard'] = True
    desires_caps['resetKeyboard'] = True
    # 驱动
    driver = webdriver.Remote('http://localhost:4723/wd/hub', desires_caps)
    return driver